package com.cty05;

import org.springframework.beans.factory.FactoryBean;
/*
*
* 工厂类实现工厂标准化的接口泛型:<getObject方法返回的对象的类>
*
*
* */

public class JavaBeanFactoryBean implements FactoryBean<JavaBean> {
    private String value;

    public void setValue(String value) {
        this.value = value;
    }

    @Override
    public JavaBean getObject() throws Exception {
        //返回的是你要实例化的对象
        JavaBean javaBean = new JavaBean();
        javaBean.setName(value);
        return javaBean;
    }

    @Override
    public Class<?> getObjectType() {
        //返回的是类的class
        return JavaBean.class;
    }
}
